import React from 'react'
import { Card } from 'antd'
import '../../../less/index.less'
import TaskListBox from './task-list-view'
import {getLangFromLocalStorage} from '../../../constant/lang-util'

const TopicTaskBox = ({ topicsTasks }) => {
  const data = topicsTasks.map((item, key) =>
    <Card title={item[`title_${getLangFromLocalStorage()}`] || item.title}
      key={key + 1}
      className='margin-t-2'
      bordered={false}>
      <TaskListBox tasks={item.all} />
    </Card>
  )
  return <div>{data}</div>
}
export default TopicTaskBox
